import muBan from './myCanvas';
export default (myCanvas, height, weight) => {
  var color = '#FF0000';
  var color_ = '#000000';

  var font = '12px Arial';
  var font2 = '30px Microsoft YaHei';
  var a = [
    '2',
    '3',
    '4',
    '5',
    '6',
    '7',
    '8',
    '9',
    '10',
    '11',
    '12',
    '13',
    '14',
    '15',
    '16',
    '17',
    '18岁',
  ];
  var l = [
    '190',
    '180',
    '170',
    '160',
    '150',
    '140',
    '130',
    '120',
    '110',
    '100',
    '90',
    '80',
    '20',
    '10',
  ];
  var r = ['190', '180', '170', '160', '150', '90', '80', '70', '60', '50', '40', '30', '20', '10'];
  var t = '身高(cm)';
  var b = '体重(kg)';
  var title = '中国2~18岁女童身高、体重百分位曲线图';
  var arr_h_3 = [
    [2, 80.9],
    [2.5, 85.2],
    [3, 88.6],
    [3.5, 92.4],
    [4, 95.8],
    [4.5, 99.2],
    [5, 102.3],
    [5.5, 105.4],
    [6, 108.1],
    [6.5, 110.6],
    [7, 113.3],
    [7.5, 116],
    [8, 118.5],
    [8.5, 121],
    [9, 123.3],
    [9.5, 125.7],
    [10, 128.3],
    [10.5, 131.1],
    [11, 134.2],
    [11.5, 137.2],
    [12, 140.2],
    [12.5, 142.9],
    [13, 145],
    [13.5, 146.7],
    [14, 147.9],
    [14.5, 148.9],
    [15, 149.5],
    [15.5, 149.9],
    [16, 149.8],
    [16.5, 149.9],
    [17, 150.1],
    [18, 150.4],
  ];
  var arr_h_10 = [
    [2, 82.9],
    [2.5, 87.4],
    [3, 90.8],
    [3.5, 94.6],
    [4, 98.1],
    [4.5, 101.5],
    [5, 104.8],
    [5.5, 108],
    [6, 110.8],
    [6.5, 113.4],
    [7, 116.2],
    [7.5, 119],
    [8, 121.6],
    [8.5, 124.2],
    [9, 126.7],
    [9.5, 129.3],
    [10, 132.1],
    [10.5, 135],
    [11, 138.2],
    [11.5, 141.2],
    [12, 144.1],
    [12.5, 146.6],
    [13, 148.6],
    [13.5, 150.2],
    [14, 151.3],
    [14.5, 152.2],
    [15, 152.8],
    [15.5, 153.1],
    [16, 153.1],
    [16.5, 153.2],
    [17, 153.4],
    [18, 153.7],
  ];
  var arr_h_25 = [
    [2, 84.9],
    [2.5, 89.6],
    [3, 93.1],
    [3.5, 96.8],
    [4, 100.4],
    [4.5, 104],
    [5, 107.3],
    [5.5, 110.6],
    [6, 113.5],
    [6.5, 116.2],
    [7, 119.2],
    [7.5, 122.1],
    [8, 124.9],
    [8.5, 127.6],
    [9, 130.2],
    [9.5, 132.9],
    [10, 135.9],
    [10.5, 138.9],
    [11, 142.2],
    [11.5, 145.2],
    [12, 148],
    [12.5, 150.4],
    [13, 152.2],
    [13.5, 153.7],
    [14, 154.8],
    [14.5, 155.6],
    [15, 156.1],
    [15.5, 156.5],
    [16, 156.4],
    [16.5, 156.5],
    [17, 156.7],
    [18, 157],
  ];
  var arr_h_50 = [
    [2, 87.2],
    [2.5, 92.1],
    [3, 95.6],
    [3.5, 99.4],
    [4, 103.1],
    [4.5, 106.7],
    [5, 110.2],
    [5.5, 113.5],
    [6, 116.6],
    [6.5, 119.4],
    [7, 122.5],
    [7.5, 125.6],
    [8, 128.5],
    [8.5, 131.3],
    [9, 134.1],
    [9.5, 137],
    [10, 140.1],
    [10.5, 143.3],
    [11, 146.6],
    [11.5, 149.7],
    [12, 152.4],
    [12.5, 154.6],
    [13, 156.3],
    [13.5, 157.6],
    [14, 158.6],
    [14.5, 159.4],
    [15, 159.8],
    [15.5, 160.1],
    [16, 160.1],
    [16.5, 160.2],
    [17, 160.3],
    [18, 160.6],
  ];
  var arr_h_75 = [
    [2, 89.5],
    [2.5, 94.6],
    [3, 98.2],
    [3.5, 102],
    [4, 105.7],
    [4.5, 109.5],
    [5, 113.1],
    [5.5, 116.5],
    [6, 119.7],
    [6.5, 122.7],
    [7, 125.9],
    [7.5, 129.1],
    [8, 132.1],
    [8.5, 135.1],
    [9, 138],
    [9.5, 141.1],
    [10, 144.4],
    [10.5, 147.7],
    [11, 151.1],
    [11.5, 154.1],
    [12, 156.7],
    [12.5, 158.8],
    [13, 160.3],
    [13.5, 161.6],
    [14, 162.4],
    [14.5, 163.1],
    [15, 163.5],
    [15.5, 163.8],
    [16, 163.8],
    [16.5, 163.8],
    [17, 164],
    [18, 164.2],
  ];
  var arr_h_90 = [
    [2, 91.7],
    [2.5, 97],
    [3, 100.5],
    [3.5, 104.4],
    [4, 108.2],
    [4.5, 112.1],
    [5, 115.7],
    [5.5, 119.3],
    [6, 122.5],
    [6.5, 125.6],
    [7, 129],
    [7.5, 132.3],
    [8, 135.4],
    [8.5, 138.5],
    [9, 141.6],
    [9.5, 144.8],
    [10, 148.2],
    [10.5, 151.6],
    [11, 155.2],
    [11.5, 158.2],
    [12, 160.7],
    [12.5, 162.6],
    [13, 164],
    [13.5, 165.1],
    [14, 165.9],
    [14.5, 166.5],
    [15, 166.8],
    [15.5, 167.1],
    [16, 167.1],
    [16.5, 167.1],
    [17, 167.3],
    [18, 167.5],
  ];
  var arr_h_97 = [
    [2, 93.9],
    [2.5, 99.3],
    [3, 102.9],
    [3.5, 106.8],
    [4, 110.6],
    [4.5, 114.7],
    [5, 118.4],
    [5.5, 122],
    [6, 125.4],
    [6.5, 128.6],
    [7, 132.1],
    [7.5, 135.5],
    [8, 138.7],
    [8.5, 141.9],
    [9, 145.1],
    [9.5, 148.5],
    [10, 152],
    [10.5, 155.6],
    [11, 159.2],
    [11.5, 162.1],
    [12, 164.5],
    [12.5, 166.3],
    [13, 167.6],
    [13.5, 168.6],
    [14, 169.3],
    [14.5, 169.8],
    [15, 170.1],
    [15.5, 170.3],
    [16, 170.3],
    [16.5, 170.4],
    [17, 170.5],
    [18, 170.7],
  ];

  var arr_w_3 = [
    [2, 9.76],
    [2.5, 10.65],
    [3, 11.5],
    [3.5, 12.32],
    [4, 13.1],
    [4.5, 13.89],
    [5, 14.64],
    [5.5, 15.39],
    [6, 16.1],
    [6.5, 16.8],
    [7, 17.58],
    [7.5, 18.39],
    [8, 19.2],
    [8.5, 20.05],
    [9, 20.93],
    [9.5, 21.89],
    [10, 22.98],
    [10.5, 24.22],
    [11, 25.74],
    [11.5, 27.43],
    [12, 29.33],
    [12.5, 31.22],
    [13, 33.09],
    [13.5, 34.82],
    [14, 36.38],
    [14.5, 37.71],
    [15, 38.73],
    [15.5, 39.51],
    [16, 39.96],
    [16.5, 40.29],
    [17, 40.44],
    [18, 40.71],
  ];
  var arr_w_10 = [
    [2, 10.39],
    [2.5, 11.35],
    [3, 12.27],
    [3.5, 13.14],
    [4, 13.99],
    [4.5, 14.85],
    [5, 15.68],
    [5.5, 16.52],
    [6, 17.32],
    [6.5, 18.12],
    [7, 19.01],
    [7.5, 19.95],
    [8, 20.89],
    [8.5, 21.88],
    [9, 22.93],
    [9.5, 24.08],
    [10, 25.36],
    [10.5, 26.8],
    [11, 28.53],
    [11.5, 30.39],
    [12, 32.42],
    [12.5, 34.39],
    [13, 36.29],
    [13.5, 38.01],
    [14, 39.55],
    [14.5, 40.84],
    [15, 41.83],
    [15.5, 42.58],
    [16, 43.01],
    [16.5, 43.32],
    [17, 43.47],
    [18, 43.73],
  ];
  var arr_w_25 = [
    [2, 11.08],
    [2.5, 12.12],
    [3, 13.11],
    [3.5, 14.05],
    [4, 14.97],
    [4.5, 15.92],
    [5, 16.84],
    [5.5, 17.78],
    [6, 18.68],
    [6.5, 19.6],
    [7, 20.62],
    [7.5, 21.71],
    [8, 22.81],
    [8.5, 23.99],
    [9, 25.23],
    [9.5, 26.61],
    [10, 28.15],
    [10.5, 29.84],
    [11, 31.81],
    [11.5, 33.86],
    [12, 36.04],
    [12.5, 38.09],
    [13, 40],
    [13.5, 41.69],
    [14, 43.19],
    [14.5, 44.43],
    [15, 45.36],
    [15.5, 46.06],
    [16, 46.47],
    [16.5, 46.76],
    [17, 46.9],
    [18, 47.14],
  ];
  var arr_w_50 = [
    [2, 11.92],
    [2.5, 13.05],
    [3, 14.13],
    [3.5, 15.16],
    [4, 16.17],
    [4.5, 17.22],
    [5, 18.26],
    [5.5, 19.33],
    [6, 20.37],
    [6.5, 21.44],
    [7, 22.64],
    [7.5, 23.93],
    [8, 25.25],
    [8.5, 26.67],
    [9, 28.19],
    [9.5, 29.87],
    [10, 31.76],
    [10.5, 33.8],
    [11, 36.1],
    [11.5, 38.4],
    [12, 40.77],
    [12.5, 42.89],
    [13, 44.79],
    [13.5, 46.42],
    [14, 47.83],
    [14.5, 48.97],
    [15, 49.82],
    [15.5, 50.45],
    [16, 50.81],
    [16.5, 51.07],
    [17, 51.2],
    [18, 51.41],
  ];
  var arr_w_75 = [
    [2, 12.84],
    [2.5, 14.07],
    [3, 15.25],
    [3.5, 16.38],
    [4, 17.5],
    [4.5, 18.66],
    [5, 19.83],
    [5.5, 21.06],
    [6, 22.27],
    [6.5, 23.51],
    [7, 24.94],
    [7.5, 26.48],
    [8, 28.05],
    [8.5, 29.77],
    [9, 31.63],
    [9.5, 33.72],
    [10, 36.05],
    [10.5, 38.53],
    [11, 41.24],
    [11.5, 43.85],
    [12, 46.42],
    [12.5, 48.6],
    [13, 50.45],
    [13.5, 51.97],
    [14, 53.23],
    [14.5, 54.23],
    [15, 54.96],
    [15.5, 55.49],
    [16, 55.79],
    [16.5, 56.01],
    [17, 56.11],
    [18, 56.28],
  ];
  var arr_w_90 = [
    [2, 13.74],
    [2.5, 15.08],
    [3, 16.36],
    [3.5, 17.59],
    [4, 18.81],
    [4.5, 20.1],
    [5, 21.41],
    [5.5, 22.81],
    [6, 24.19],
    [6.5, 25.62],
    [7, 27.28],
    [7.5, 29.08],
    [8, 30.95],
    [8.5, 33],
    [9, 35.26],
    [9.5, 37.79],
    [10, 40.63],
    [10.5, 43.61],
    [11, 46.78],
    [11.5, 49.73],
    [12, 52.49],
    [12.5, 54.71],
    [13, 56.46],
    [13.5, 57.81],
    [14, 58.88],
    [14.5, 59.7],
    [15, 60.28],
    [15.5, 60.69],
    [16, 60.91],
    [16.5, 61.07],
    [17, 61.15],
    [18, 61.28],
  ];
  var arr_w_97 = [
    [2, 14.71],
    [2.5, 16.16],
    [3, 17.55],
    [3.5, 18.89],
    [4, 20.24],
    [4.5, 21.67],
    [5, 23.14],
    [5.5, 24.72],
    [6, 26.3],
    [6.5, 27.96],
    [7, 29.89],
    [7.5, 32.01],
    [8, 34.23],
    [8.5, 36.69],
    [9, 39.41],
    [9.5, 42.51],
    [10, 45.97],
    [10.5, 49.59],
    [11, 53.33],
    [11.5, 56.67],
    [12, 59.64],
    [12.5, 61.86],
    [13, 63.45],
    [13.5, 64.55],
    [14, 65.36],
    [14.5, 65.93],
    [15, 66.3],
    [15.5, 66.55],
    [16, 66.69],
    [16.5, 66.78],
    [17, 66.82],
    [18, 66.89],
  ];

  var m = new muBan(35, 60, 100, 100);
  var c = document.getElementById(myCanvas);
  var ctx = c.getContext('2d');

  m.box(ctx, color, 0.75, 0.2, 17, 68, 15, 150); //画格子
  m.txt(ctx, color, font, a, a, l, r, t, b, 17, 15); //写字
  m.title(ctx, color, font2, title, 17);

  //身高
  m.line(ctx, 218, color, 2, arr_h_3, 11, 80, 10, 2, false, false, '3');
  m.line(ctx, 218, color, 0.5, arr_h_10, 11, 80, 10, 2, false, false, '10');
  m.line(ctx, 218, color, 0.5, arr_h_25, 11, 80, 10, 2, false, false, '25');
  m.line(ctx, 218, color, 2, arr_h_50, 11, 80, 10, 2, false, false, '50');
  m.line(ctx, 218, color, 0.5, arr_h_75, 11, 80, 10, 2, false, false, '75');
  m.line(ctx, 218, color, 0.5, arr_h_90, 11, 80, 10, 2, false, false, '90');
  m.line(ctx, 218, color, 2, arr_h_97, 11, 80, 10, 2, false, false, '97');

  //体重
  m.line(ctx, 218, color, 2, arr_w_3, 13, 10, 10, 2, false, false, '3');
  m.line(ctx, 218, color, 0.5, arr_w_10, 13, 10, 10, 2, false, false, '10');
  m.line(ctx, 218, color, 0.5, arr_w_25, 13, 10, 10, 2, false, false, '25');
  m.line(ctx, 218, color, 2, arr_w_50, 13, 10, 10, 2, false, false, '50');
  m.line(ctx, 218, color, 0.5, arr_w_75, 13, 10, 10, 2, false, false, '75');
  m.line(ctx, 218, color, 0.5, arr_w_90, 13, 10, 10, 2, false, false, '90');
  m.line(ctx, 218, color, 2, arr_w_97, 13, 10, 10, 2, false, false, '97');

  height && m.line(ctx, 218, color_, 1, height, 11, 80, 10, 2, true, false, null); //身高
  weight && m.line(ctx, 218, color_, 1, weight, 13, 10, 10, 2, true, false, null); //体重
};
